using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using WinformTemplete.Models;
using WinformTemplete.Modules.Blog.Models;

namespace WinformTemplete.Modules.Blog.Repositories
{
    /// <summary>
    /// 博客仓储接口
    /// </summary>
    public interface IBlogRepository
    {
        /// <summary>
        /// 获取所有博客
        /// </summary>
        Task<List<BlogModel>> GetAllAsync();

        /// <summary>
        /// 根据ID获取博客
        /// </summary>
        Task<BlogModel> GetByIdAsync(int id);

        /// <summary>
        /// 添加博客
        /// </summary>
        Task<bool> AddAsync(BlogModel blog);

        /// <summary>
        /// 更新博客
        /// </summary>
        Task<bool> UpdateAsync(BlogModel blog);

        /// <summary>
        /// 删除博客
        /// </summary>
        Task<bool> DeleteAsync(int id);

        /// <summary>
        /// 根据标题搜索博客
        /// </summary>
        Task<List<BlogModel>> SearchByTitleAsync(string title);

        /// <summary>
        /// 获取最近发布的博客
        /// </summary>
        Task<List<BlogModel>> GetRecentBlogsAsync(int count);

        /// <summary>
        /// 获取博客总数
        /// </summary>
        Task<int> GetTotalCountAsync();

        /// <summary>
        /// 分页获取博客
        /// </summary>
        Task<List<BlogModel>> GetPagedBlogsAsync(int pageIndex, int pageSize);

        /// <summary>
        /// 根据创建日期范围获取博客
        /// </summary>
        Task<List<BlogModel>> GetBlogsByDateRangeAsync(DateTime startDate, DateTime endDate);
    }
} 